	#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

void function_f();
void function_g();


void function_f(){
  
  /*va contenir les adresses des appelants*/
  void *buffer[10];
  /*va contenir les traduction en symboles*/
  char **strings;

  int nptrs = backtrace(buffer, 10);
  printf("backtrace() returned %d addresses\n", nptrs);
  
  
  strings = backtrace_symbols(buffer, nptrs);
  
  for (int j = 0; j < nptrs; j++)
    printf("buffer[%d]=%p => sym: %s\n", j,buffer[j],strings[j]);
  
  free(strings);
   
}

void function_g(){
  function_f();
}

int main(void){
  function_g();
}
